﻿@{
    Layout = null;
    var data = (Apps.Web.Model.LineStackModel)Model;
    string SeriesStr = "";
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ECharts</title>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
</head>
<body style="margin:0 0 0 0">
    <div id="charts" style="width:100%;height:250px; "></div>    
    <script src="~/Scripts/echarts.min.js"></script>
    <script src="~/Scripts/common.js"></script>
    <script type="text/javascript">
        option = {
            color: ['#87cefa', '#ff7f50','#da70d6'],
            tooltip: {
                trigger: 'axis'
            },
            toolbox: {
                feature: {
                    magicType:{show:true,type:['line','bar']},
                    saveAsImage: {}
                }
            },
            legend: {
                data: @Html.Raw(data.Legend)
                },
            grid: {
                x: 35,
                y: 25,
                x2: 15,
                y2: 25
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: @Html.Raw(data.xAxisData)
                },
            yAxis: {
                type: 'value'
            },
            series: [
                @foreach(var item in data.Series)
                {
                    if (string.IsNullOrWhiteSpace(SeriesStr))
                    {
                        SeriesStr += "{name: '" + item.name + "', type: 'line', data: " + item.data + "}";
                    }
                    else
                    {
                        SeriesStr += ",{name: '" + item.name + "', type: 'line', data: " + item.data + "}";
                    }
                }
                @Html.Raw(SeriesStr)
            ]
        };

        $(function () {
            var myChart = echarts.init(document.getElementById('charts'));
            myChart.setOption(option, true);
            myChart.on("click",function (parms){
                var QueryYear=getQueryString("QueryYear");
                var QueryMonth=getQueryString("QueryMonth");
                var MATERIEL_ID=getQueryString("MATERIEL_ID");
                var SUPPLIER_ID=getQueryString("SUPPLIER_ID");
                var TRANSPORT_ID=getQueryString("TRANSPORT_ID");
                var Day=parms.name;

                parent.parent.ShowChildReportWindow("@Url.Action("LevelThree")?QueryYear="+QueryYear+"&QueryMonth="+QueryMonth+"&Day="+Day+"&MATERIEL_ID="+MATERIEL_ID +"&SUPPLIER_ID="+SUPPLIER_ID+"&TRANSPORT_ID="+TRANSPORT_ID,parms.name+'日进煤详情');

            });
        })
    </script>
</body>
</html>
